<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>按钮水波</title>
        <style>
            * {
                margin: 0px;
                padding: 0px;
            }
            #container {
                display: flex;
                align-items: center;
                justify-content: center;
                width: 100%;
                height: 100vh;
            }
            .glass {
                width: 120px;
                height: 50px;
                background-color: rgba(0, 214, 225, 0.8);
                border: 0px;
            }
        </style>
        <style>
            .button {
                position: relative;
                overflow: hidden;
                width: 100px;
                height: 50px;
                border: none;
                background: dodgerblue;
                color: white;
            }

            .button::after {
                content: "";
                background: rgba(255, 255, 255, 0.8);
                display: block; /* By default, :after and :before has display:none; */
                position: absolute;
                padding-bottom: 100%; /* This makes it circle shape and responsive */
                width: 500%;
                top: -50%;
                left: -50%;
                z-index: 2;
                opacity: 0;
                transform: translate(-50%, -50%) scale(0);
                pointer-events: none; /* So you can still click/hover below it */
                animation: ripple 1s;
            }

            @keyframes ripple {
                0% {
                    transform: translate(-50%, -50%) scale(0);
                    opacity: 1;
                }
                50% {
                    opacity: 0.4;
                }
                100% {
                    transform: translate(-50%, -50%) scale(2);
                    opacity: 0;
                }
            }
        </style>
        <script type="text/javascript" src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    </head>
    <body>
        <div id="container">
            <button class="glass" type="button">水波效果</button>
            <button class="button" type="button">水波效果2</button>
        </div>
    </body>
</html>
